﻿using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ECO.EventBus.Infrastructure
{
    // 事件处理器接口
    public interface IEventHandler<in TEvent> where TEvent : IEvent
    {
        Task HandleAsync(TEvent @event);
        void HandleException(TEvent @event, Exception ex)
        {
            Console.WriteLine($"{typeof(TEvent).Name}事件处理异常 {Environment.NewLine}{ex}");
        }
    }
}
